package com.dure.hotmemory.scenes;

import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.LinearGradient;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.Shader;
import android.util.Log;

import com.dure.hotmemory.drawview.BaseSurfaceView;

/**
 * Created by dure on 2017/4/7.
 */

public class BgScene extends BaseScene {
    Paint paint = new Paint();
    private int number = 5;
    int[] colors = {Color.WHITE, Color.parseColor("#00BDFF")};

    public BgScene(BaseSurfaceView baseSurfaceView) {
        super(baseSurfaceView);
        paint.setAntiAlias(true);
    }

    @Override
    public void initData() {
        Log.d("lesleixz", "number = " + 5);
    }

    @Override
    public void handleData() {

    }

    @Override
    public void handleDraw(Canvas canvas) {
        Rect rect = new Rect(0, 0, canvas.getWidth(), canvas.getHeight());
        LinearGradient lg = new LinearGradient(rect.width() / 2, 0, rect.width() / 2, rect.height(), colors, null, Shader.TileMode.MIRROR);
        paint.setShader(lg);
//        canvas.drawColor(Color.parseColor("#A5C1F5"));
        canvas.drawRect(rect, paint);
    }
}
